package cn.hdu.liang.concurrency;

import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Exam4 {
    public static void main(String[] args) {
        ExecutorService exec = Executors.newCachedThreadPool();
        //ExecutorService exec = Executors.newFixedThreadPool(100);
        //ExecutorService exec = Executors.newSingleThreadExecutor();
        Random random = new Random(System.currentTimeMillis());
        for(int i = 0; i < 100; i++) {
            exec.execute(new ExamFib(random.nextInt(40)));
        }
        exec.shutdown();
        System.out.println("Main 函数结束");
    }
}
